//
//  UIButton+KFD.m
//  
//
//  Created by JIRENTIANXIANG on 6/14/15.
//
//

#import "UIButton+KFD.h"
#import "ui_config.h"

@implementation UIButton (KFD)

+(UIButton*)buttonWithTitle:(NSString*)title
{
    UIButton* button=[UIButton buttonWithType:UIButtonTypeSystem];
    [button setTitle:title forState:UIControlStateNormal];
    button.frame=CGRectMake(0, 0, SCREEN_WIDTH-20*2, 40);
    button.titleLabel.font=[UIFont systemFontOfSize:19];
    button.layer.cornerRadius=5;
    return button;
}

+(UIButton*)redButtonWithtitle:(NSString *)title
{
    UIButton* button=[UIButton buttonWithTitle:title];
    button.backgroundColor=KFD_RED;
    [button setTitleColor:KFD_WHITE forState:UIControlStateNormal];
    return button;
}

+(UIButton*)whiteButtonWithTitle:(NSString *)title
{
    UIButton* button=[UIButton buttonWithTitle:title];
    button.backgroundColor=KFD_WHITE;
    [button setTitleColor:KFD_TEXT_DARK_GRAY forState:UIControlStateNormal];
    return button;
}

+(UIButton*)framedWhiteButtonWithTitle:(NSString *)title
{
    UIButton* button=[UIButton buttonWithType:UIButtonTypeSystem];
    [button setTitle:title forState:UIControlStateNormal];
    button.frame=CGRectMake(0, 0, 110, 35);
    button.backgroundColor=KFD_WHITE;
    button.titleLabel.font=[UIFont systemFontOfSize:14];
    [button setTitleColor:KFD_TEXT_DARK_GRAY forState:UIControlStateNormal];
    button.layer.cornerRadius=3;
    button.layer.borderWidth=1;
    button.layer.borderColor=KFD_BG_COLOR.CGColor;
    return button;
}

@end
